﻿@using KL.Store.Core;
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title | @Parameters.WebSiteTitle</title>
    @*<meta name="keywords" content='@ViewBag.Keywords'/>*@
    <meta name="description" content='@ViewBag.Description'/>
    @if (!string.IsNullOrEmpty(Parameters.FaceBookAppId))
    {
        <meta property="fb:app_id" content="@Parameters.FaceBookAppId"/>
    }
    <link href="~/Images/Default/favicon.png" rel="shortcut icon" type="image/x-icon" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <meta name="viewport" content="width=device-width" />
    <link href="@Url.Content("~/Content/" + Parameters.Theme + "/stylesheet.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/cloud-zoom.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/simple_menu.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/" + Parameters.Theme + "/slideshow.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/" + Parameters.Theme + "/livesearch.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/carousel.css")" rel="stylesheet" type="text/css" />
    <script src="@(Parameters.WebSiteScriptUrl)@Url.Content("~/scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
    <script src="@(Parameters.WebSiteScriptUrl)@Url.Content("~/scripts/jquery-ui-1.8.16.custom.min.js")" type="text/javascript"></script>
    <script src="@(Parameters.WebSiteScriptUrl)@Url.Content("~/scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
    <script src="@(Parameters.WebSiteScriptUrl)@Url.Content("~/scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@(Parameters.WebSiteScriptUrl)@Url.Content("~/scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@(Parameters.WebSiteScriptUrl)@Url.Content("~/scripts/jquery.nivo.slider.pack.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/font-awesome.min.css")" rel="stylesheet" />
    @*    <script src="@(Parameters.WebSiteScriptUrl)@Url.Content("~/scripts/jquery.prettyPhoto.js")" type="text/javascript"></script>
    <script src="@(Parameters.WebSiteScriptUrl)@Url.Content("~/scripts/jquery.bxSlider.min.js")" type="text/javascript"></script>
    <script src="@(Parameters.WebSiteScriptUrl)@Url.Content("~/scripts/cloud-zoom.1.0.2.js")" type="text/javascript"></script>
    <script src="@(Parameters.WebSiteScriptUrl)@Url.Content("~/scripts/jquery.jcarousel.min.js")" type="text/javascript"></script>
    <script src="@(Parameters.WebSiteScriptUrl)@Url.Content("~/scripts/easyTooltip.js")" type="text/javascript"></script>
    <script src="@(Parameters.WebSiteScriptUrl)@Url.Content("~/scripts/tabs.js")" type="text/javascript"></script>
    <script src="@(Parameters.WebSiteScriptUrl)@Url.Content("~/scripts/script.js")" type="text/javascript"></script>*@
    <meta name="language" content="Turkish">
    <meta name="content-language" content="tr-TR" />

    <script type="text/javascript">
        function GetSearchProduct()
        {
            var myText = $("#Search").val();
            $.ajax({
                url: '/Search/LiveSearch?search=' + myText,
                type: 'POST',
                success: function (result)
                {
                    $("#divLoadingGif").css("display", "none");
                    var myProductList = $(result);
                    var myHtlmString = '';
                    $.each(myProductList[0].LiveSearch, function (key, val)
                    {
                        myHtlmString += '<li><a href="' + val.LinkUrl + '">' + val.ProductCode + ' - ' + val.ProductName + '</a></li>';
                    });
                    myHtlmString = '<ul id="live_search_results">' + myHtlmString + '</ul>';
                    $("#divSearchResult").html(myHtlmString);
                }
            });
        }
        var search = (function ()
        {
            var builder = function ()
            {
                $(document).ready(function ()
                {
                    var object = $('#Search', $('.window.searchview').hide().parent()).focus(function ()
                    {
                        this.active = true;
                        var value = $.trim(this.value);
                        if (value == object.data('empty'))
                        {
                            object.val('').parent().addClass('focus');
                        } else if (value.length >= 3) { search.show(); }
                    }).blur(function ()
                    {
                        this.active = false;

                        $(this.parentNode).removeClass('focus');
                        if ($.trim(object.val()) == '') { object.val(object.data('empty')); }
                    }).keyup(function ()
                    {
                        if (object.val().length >= 4)
                        {
                            $("#divLoadingGif").css("display", "block");
                            GetSearchProduct();
                            search.show();
                            $(this.parentNode).removeClass('focus');
                        } else
                        {
                            search.hide();
                            $(this.parentNode).addClass('focus');
                        }
                    });

                    var parent = object.parents('.container').hover(function () { this.active = true; }, function ()
                    {
                        this.active = false;
                        if (!object.prop('active')) { search.hide(); }
                    });
                });
            }
            builder.prototype = {
                busy: false,
                show: function () { $('.window.searchview').stop(true, true).animate({ opacity: 'show', height: 'show' }, 'fast'); },
                hide: function () { $('.window.searchview').stop(true, true).animate({ opacity: 'hide', height: 'hide' }, 'fast'); }
            };

            return new builder();
        })();
    </script>
    @Html.Raw(Parameters.LiveChatScript)
</head>
<body class="common-home">
    <div class="main-shining">
        <p id="back-top">
            <a href="#top"><span></span></a>
        </p>
        <div class="row-1">
            <div id="header">
                <div class="header-top">
                    <div id="logo" style="float: right; position: absolute; top: 0; z-index: 3">
                        <a href="@(Parameters.WebSiteUrl)">
                            <img src="/Images/Default/jojumon_logo.png" title="@(Parameters.WebSiteTitle)" alt="@(Parameters.WebSiteTitle)" /></a>
                    </div>
                    <div class="right-header">
                        @Html.Raw(Parameters.PageMainMenu)
                        <div class="clear">
                        </div>
                    </div>
                </div>
                <div class="header-row">
                    <form id="searchForm" action="/Search/Index">
                        <div id="searchDiv">
                            <div class="search-right">
                                <div class="button-search" onclick="searchForm.submit();">
                                </div>
                                <span class="search-bg">
                                    <input type="text" name="Search" id="Search" placeholder="Ara" onkeydown="this.style.color = '#b3b3b3';"
                                        autocomplete="off" />
                                </span>
                            </div>
                            <div id="livesearch_search_results" class="window searchview" style="display: none;">
                                <div id="divSearchResult" style="width: 440px; padding: 6px;">
                                </div>
                            </div>
                        </div>
                    </form>
                    <div class="cart-inner">
                        <div id="cart">
                            @{
                                Html.RenderAction("GetSummary2", "Cart");
                            }
                        </div>
                        <div style="float: left">
                            <h4>Sepetim:</h4>
                        </div>
                    </div>
                    <div class="clear">
                    </div>
                </div>
                @{
                    Html.RenderAction("Login", "Partials");
                }
                @RenderSection("sidebar", required: false)
            </div>
            <div class="clear">
            </div>
        </div>
        <div id="container">
            <div id="notification">
            </div>
            <div id="column-left">
                <script type="text/javascript">
                    $(document).ready(function ()
                    {
                        $(".act-cat").toggle(
                                function ()
                                {
                                    $(this).next('.level-2-cat').slideToggle("slow"), {
                                        duration: 'slow',
                                        easing: 'easeOutBounce'
                                    };
                                },
                                function ()
                                {
                                    $(this).next('.level-2-cat').slideToggle("slow"), {
                                        duration: 'slow',
                                        easing: 'easeOutBounce'
                                    };
                                }
                            );
                        $('.box-category li').last().addClass('last');
                        $('.box-category li li').last().addClass('last');
                    });
                </script>
                @RenderSection("menu", required: false)
                @RenderSection("brands", required: false)
                @RenderSection("bestseller", required: false)
                @RenderSection("account", required: false)
                @RenderSection("info", required: false)
            </div>
            <div id="content">
                @RenderSection("featured", required: false)
                @RenderSection("relatedlists", required: false)
                @RenderBody()
            </div>
        </div>
        <div class="clear">
        </div>
        <footer>
            @Html.Raw(Parameters.PageFooter)
        </footer>
    </div>
    <div id="Loading">
        <div class="Loading">
            <img src="/Images/Default/loading.gif" alt="Loading" />
        </div>
    </div>
    <script type="text/javascript">
        $('#Loading').hide();

        $('a.pLink222').click(function ()
        {
            var qsId = $(this).attr('id').split("_")[1];
            $('#content').load('/Products/Get', { id: qsId });

            $('a.pLink').removeClass("active");
            $('a.cLink').removeClass("active");
            $(this).addClass("active");
            return false;
        });
        $('a.cLink222').click(function ()
        {
            var qsId = $(this).attr('id').split("_")[1];
            $('#content').load('/Categories/Get', { id: qsId });

            $('a.pLink').removeClass("active");
            $('a.cLink').removeClass("active");
            $(this).addClass("active");
            return false;
        });

        var afth = $('a.cLink[href="' + location.pathname + '"]');
        if (afth.attr('id') == undefined)
        {
            afth = $('a.pLink[href="' + location.pathname + '"]');
        }

        if (afth.attr('id') != undefined)
        {
            afth.addClass('active');

            afth.parents('ul').css('display', 'block');

            afth.parent().addClass('active');
            afth.parent().parents('ul').css('display', 'block');
            afth.parent('ul').css('display', 'block');
        }
    </script>
    @Html.Raw(Parameters.AddThisShareButtonsSmartLayerScript)
</body>
</html>
